package com.ruoyi.agriculture.knowledge.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.agriculture.knowledge.mapper.ZsKnowledgeNodesMapper;
import com.ruoyi.agriculture.knowledge.domain.ZsKnowledgeNodes;
import com.ruoyi.agriculture.knowledge.service.IZsKnowledgeNodesService;

import javax.annotation.Resource;

/**
 * 知识图谱节点Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-01
 */
@Service
public class ZsKnowledgeNodesServiceImpl implements IZsKnowledgeNodesService 
{
    @Resource
    private ZsKnowledgeNodesMapper zsKnowledgeNodesMapper;

    /**
     * 查询知识图谱节点
     * 
     * @param id 知识图谱节点主键
     * @return 知识图谱节点
     */
    @Override
    public ZsKnowledgeNodes selectZsKnowledgeNodesById(Long id)
    {
        return zsKnowledgeNodesMapper.selectZsKnowledgeNodesById(id);
    }

    /**
     * 查询知识图谱节点列表
     * 
     * @param zsKnowledgeNodes 知识图谱节点
     * @return 知识图谱节点
     */
    @Override
    public List<ZsKnowledgeNodes> selectZsKnowledgeNodesList(ZsKnowledgeNodes zsKnowledgeNodes)
    {
        return zsKnowledgeNodesMapper.selectZsKnowledgeNodesList(zsKnowledgeNodes);
    }

    /**
     * 新增知识图谱节点
     * 
     * @param zsKnowledgeNodes 知识图谱节点
     * @return 结果
     */
    @Override
    public int insertZsKnowledgeNodes(ZsKnowledgeNodes zsKnowledgeNodes)
    {
        zsKnowledgeNodes.setCreateTime(DateUtils.getNowDate());
        return zsKnowledgeNodesMapper.insertZsKnowledgeNodes(zsKnowledgeNodes);
    }

    /**
     * 修改知识图谱节点
     * 
     * @param zsKnowledgeNodes 知识图谱节点
     * @return 结果
     */
    @Override
    public int updateZsKnowledgeNodes(ZsKnowledgeNodes zsKnowledgeNodes)
    {
        return zsKnowledgeNodesMapper.updateZsKnowledgeNodes(zsKnowledgeNodes);
    }

    /**
     * 批量删除知识图谱节点
     * 
     * @param ids 需要删除的知识图谱节点主键
     * @return 结果
     */
    @Override
    public int deleteZsKnowledgeNodesByIds(Long[] ids)
    {
        return zsKnowledgeNodesMapper.deleteZsKnowledgeNodesByIds(ids);
    }

    /**
     * 删除知识图谱节点信息
     * 
     * @param id 知识图谱节点主键
     * @return 结果
     */
    @Override
    public int deleteZsKnowledgeNodesById(Long id)
    {
        return zsKnowledgeNodesMapper.deleteZsKnowledgeNodesById(id);
    }
}
